package com.example.demo.hutool;

import cn.hutool.cache.CacheUtil;
import cn.hutool.core.io.file.FileReader;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.io.BufferedReader;
import java.io.File;

/**
 * Created by liujiahao on 2019/1/31.
 */
public class Cache {
    public static void main(String[] args) {
        FileReader  reader=new FileReader(File.separator+"git"+File.separator+"api.json");
        BufferedReader reader1=reader.getReader();
        System.out.println(reader1);
        //json();
    }
    public static void fifoCache(){
        CacheUtil.newFIFOCache(3);
    }
    public static  void json(){
        String jsonStr = "{\"b\":\"value2\",\"c\":\"value3\",\"a\":\"value1\"}";
//方法一：使用工具类转换
        JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
        System.out.println(JSONUtil.toXmlStr(jsonObject));
    }
}
